<%-- 
    Document   : Modulo2Save
    Created on : 07-oct-2011, 6:19:31
    Author     : PC-01
--%>

<%@page import="java.sql.*" %>
<%@page import="java.util.*" %>
<%
        Connection conn = null;
        try {
            String sc = "jdbc:mysql://localhost:3306/upeu?user=root&password=";
            Class.forName("com.mysql.jdbc.Driver");
            conn = DriverManager.getConnection(sc);
            System.out.println("Conectado");
            //test
            String qry="insert into `User`(Photo  , `Name` , Email , Cellular, Login,Password,Privilege,ActiveAcount ) values(?,?,?,?,?,?,?,?)";
            PreparedStatement ps=conn.prepareStatement(qry);
            ps.setString(1, request.getParameter("Photo  "));
            ps.setString(2, request.getParameter("`Name` "));
            ps.setString(3, request.getParameter("Email "));
            ps.setString(4, request.getParameter("Cellular"));
            ps.setString(5, request.getParameter("Login "));
            ps.setString(6, request.getParameter("Password"));
            ps.setString(7, request.getParameter("Privilege"));
            ps.setString(8, request.getParameter("ActiveAcount"));
            //ps.setInt(2, Integer.parseInt(request.getParameter("hras")) );
            int r=ps.executeUpdate();
            out.println(r+" registros agregados en la tabla `User` "+"<br>");
            
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }
%>  
<a href="Modulo1Main.jsp">Volver->></a>
